//
// Created by 62607 on 25-8-6.
//
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> flag(n + 1);
    vector<int> primes;
    flag[1] = true;
    for (int i = 2; i <= n; ++i) {
        if (!flag[i]) {
            primes.push_back(i);
        }
        for (auto zhishu: primes) {
            if (zhishu * i > n) break;
            flag[zhishu * i] = true;
            if (i % zhishu == 0) break;
        }
    }

    for (auto zhishu: primes) {
        cout << zhishu << " ";
    }
    return 0;
}
